window.onload = function(){
    let username = document.getElementById("username")
    let password = document.getElementById("password")
    console.log(username.value)

    username.addEventListener("input",(e)=>{
        console.log("正在输入",e.target.value)
    })

    let name = username.value
    let key = password.value

    let btn = document.querySelector("button")
    btn.addEventListener("click",(e)=>{
        e.preventDefault()
// fetch基于promis用于发送http请求
        fetch("http://172.18.26.111:8080/login" + "?username" +name + "&key" + key , {method:"GET"})
        .then(()=>console.log("GET请求成功了"))
        location.href = "http://172.18.26.111:8080/login";
    })
}